package org.abluedog.ssfb.listeners;

import org.abluedog.ssfb.StartSurvivalFromBaby;
import org.abluedog.ssfb.events.EatEvent;
import org.abluedog.ssfb.pdc.BodyComposition;
import org.abluedog.ssfb.utils.SsfbUtil;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class EatListener implements Listener {

    @EventHandler
    public void onEat(EatEvent event) {
        BodyComposition bodyCompositionByPlayer = SsfbUtil.getBodyCompositionByPlayer(event.getPlayer(), StartSurvivalFromBaby.getPlugin());
        switch (event.getMaterial()){
            case APPLE:
                event.getPlayer().sendMessage("你吃掉了苹果");
                break;
            case BREAD:
                event.getPlayer().sendMessage("你吃掉了面包");
                break;
            case MELON:
                event.getPlayer().sendMessage("你吃掉了西瓜");
                break;
            case POTATO:
                event.getPlayer().sendMessage("你吃掉了土豆");
                break;
            case CARROT:
                event.getPlayer().sendMessage("你吃掉了胡萝卜");
        }
    }
}
